<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>YDLIDAR-SS SDK: include/serial.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="ydliar.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">YDLIDAR-SS SDK
   &#160;<span id="projectnumber">V2.0.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">serial.h</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#ifndef SERIAL_H</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor">#define SERIAL_H</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;</div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="preprocessor">#include &lt;limits&gt;</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="preprocessor">#include &lt;string&gt;</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="preprocessor">#include &lt;cstring&gt;</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="preprocessor">#include &lt;sstream&gt;</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="preprocessor">#include &quot;v8stdint.h&quot;</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;</div><div class="line"><a name="l00011"></a><span class="lineno"><a class="line" href="namespaceserial.html">   11</a></span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceserial.html">serial</a> {</div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;</div><div class="line"><a name="l00016"></a><span class="lineno"><a class="line" href="namespaceserial.html#a00b3281fa11cea770c0b0c8a106080f8">   16</a></span>&#160;<span class="keyword">typedef</span> <span class="keyword">enum</span> {</div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;  fivebits = 5,</div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;  sixbits = 6,</div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;  sevenbits = 7,</div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;  eightbits = 8</div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;} <a class="code" href="namespaceserial.html#a00b3281fa11cea770c0b0c8a106080f8">bytesize_t</a>;</div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;</div><div class="line"><a name="l00026"></a><span class="lineno"><a class="line" href="namespaceserial.html#a8f45d26bf7c9a06659e75b5004a50481">   26</a></span>&#160;<span class="keyword">typedef</span> <span class="keyword">enum</span> {</div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;  parity_none = 0,</div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;  parity_odd = 1,</div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;  parity_even = 2,</div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;  parity_mark = 3,</div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;  parity_space = 4</div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;} <a class="code" href="namespaceserial.html#a8f45d26bf7c9a06659e75b5004a50481">parity_t</a>;</div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;</div><div class="line"><a name="l00037"></a><span class="lineno"><a class="line" href="namespaceserial.html#af5b116611d6628a3aa8f788fdc09f469">   37</a></span>&#160;<span class="keyword">typedef</span> <span class="keyword">enum</span> {</div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;  stopbits_one = 1,</div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;  stopbits_two = 2,</div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;  stopbits_one_point_five</div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;} <a class="code" href="namespaceserial.html#af5b116611d6628a3aa8f788fdc09f469">stopbits_t</a>;</div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;</div><div class="line"><a name="l00046"></a><span class="lineno"><a class="line" href="namespaceserial.html#a93ef57a314b4e562f9eded6c15d34351">   46</a></span>&#160;<span class="keyword">typedef</span> <span class="keyword">enum</span> {</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;  flowcontrol_none = 0,</div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;  flowcontrol_software,</div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;  flowcontrol_hardware</div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;} <a class="code" href="namespaceserial.html#a93ef57a314b4e562f9eded6c15d34351">flowcontrol_t</a>;</div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;</div><div class="line"><a name="l00058"></a><span class="lineno"><a class="line" href="structserial_1_1_timeout.html">   58</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structserial_1_1_timeout.html">Timeout</a> {</div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;<span class="preprocessor">#ifdef max</span></div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;<span class="preprocessor"># undef max</span></div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;  <span class="keyword">static</span> uint32_t max() {</div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;    <span class="keywordflow">return</span> std::numeric_limits&lt;uint32_t&gt;::max();</div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;  }</div><div class="line"><a name="l00074"></a><span class="lineno"><a class="line" href="structserial_1_1_timeout.html#aa4fbd72e16f47c9aea9fb3c32ca17828">   74</a></span>&#160;  <span class="keyword">static</span> <a class="code" href="structserial_1_1_timeout.html">Timeout</a> <a class="code" href="structserial_1_1_timeout.html#aa4fbd72e16f47c9aea9fb3c32ca17828">simpleTimeout</a>(uint32_t timeout) {</div><div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="structserial_1_1_timeout.html">Timeout</a>(max(), timeout, 0, timeout, 0);</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;  }</div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;</div><div class="line"><a name="l00079"></a><span class="lineno"><a class="line" href="structserial_1_1_timeout.html#ada15f2a0ae478cbb62ef79d1633b2b81">   79</a></span>&#160;  uint32_t <a class="code" href="structserial_1_1_timeout.html#ada15f2a0ae478cbb62ef79d1633b2b81">inter_byte_timeout</a>;</div><div class="line"><a name="l00081"></a><span class="lineno"><a class="line" href="structserial_1_1_timeout.html#a099244649dec66b6e0548480edeb2b9f">   81</a></span>&#160;  uint32_t <a class="code" href="structserial_1_1_timeout.html#a099244649dec66b6e0548480edeb2b9f">read_timeout_constant</a>;</div><div class="line"><a name="l00085"></a><span class="lineno"><a class="line" href="structserial_1_1_timeout.html#a64412753eb2edf1621716dd9f1a4e71e">   85</a></span>&#160;  uint32_t <a class="code" href="structserial_1_1_timeout.html#a64412753eb2edf1621716dd9f1a4e71e">read_timeout_multiplier</a>;</div><div class="line"><a name="l00087"></a><span class="lineno"><a class="line" href="structserial_1_1_timeout.html#accf01b97f83564f4ce3d6e5f63e21006">   87</a></span>&#160;  uint32_t <a class="code" href="structserial_1_1_timeout.html#accf01b97f83564f4ce3d6e5f63e21006">write_timeout_constant</a>;</div><div class="line"><a name="l00091"></a><span class="lineno"><a class="line" href="structserial_1_1_timeout.html#a31ddae32907cff9c3d27fa763981317d">   91</a></span>&#160;  uint32_t <a class="code" href="structserial_1_1_timeout.html#a31ddae32907cff9c3d27fa763981317d">write_timeout_multiplier</a>;</div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;</div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;  <span class="keyword">explicit</span> <a class="code" href="structserial_1_1_timeout.html">Timeout</a>(uint32_t inter_byte_timeout_ = 0,</div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;                   uint32_t read_timeout_constant_ = 0,</div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;                   uint32_t read_timeout_multiplier_ = 0,</div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;                   uint32_t write_timeout_constant_ = 0,</div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;                   uint32_t write_timeout_multiplier_ = 0)</div><div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;    : inter_byte_timeout(inter_byte_timeout_),</div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;      read_timeout_constant(read_timeout_constant_),</div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;      read_timeout_multiplier(read_timeout_multiplier_),</div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;      write_timeout_constant(write_timeout_constant_),</div><div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;      write_timeout_multiplier(write_timeout_multiplier_)</div><div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;  {}</div><div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;};</div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;</div><div class="line"><a name="l00109"></a><span class="lineno"><a class="line" href="classserial_1_1_serial.html">  109</a></span>&#160;<span class="keyword">class </span><a class="code" href="classserial_1_1_serial.html">Serial</a>  {</div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160; <span class="keyword">public</span>:</div><div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;  <span class="keyword">explicit</span> <a class="code" href="classserial_1_1_serial.html">Serial</a>(<span class="keyword">const</span> std::string &amp;port = <span class="stringliteral">&quot;&quot;</span>,</div><div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;                  uint32_t baudrate = 9600,</div><div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;                  <a class="code" href="structserial_1_1_timeout.html">Timeout</a> timeout = <a class="code" href="structserial_1_1_timeout.html">Timeout</a>(),</div><div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;                  <a class="code" href="namespaceserial.html#a00b3281fa11cea770c0b0c8a106080f8">bytesize_t</a> bytesize = eightbits,</div><div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;                  <a class="code" href="namespaceserial.html#a8f45d26bf7c9a06659e75b5004a50481">parity_t</a> parity = parity_none,</div><div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;                  stopbits_t stopbits = stopbits_one,</div><div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;                  flowcontrol_t flowcontrol = flowcontrol_none);</div><div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;</div><div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;  <span class="keyword">virtual</span> ~<a class="code" href="classserial_1_1_serial.html">Serial</a>();</div><div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;</div><div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;  <span class="keywordtype">bool</span> open();</div><div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;</div><div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;  <span class="keywordtype">bool</span> isOpen();</div><div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;</div><div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;  <span class="keywordtype">void</span> closePort();</div><div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;</div><div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;  <span class="keywordtype">size_t</span> available();</div><div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;</div><div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;  <span class="keywordtype">bool</span> waitReadable();</div><div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;</div><div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;  <span class="keywordtype">void</span> waitByteTimes(<span class="keywordtype">size_t</span> count);</div><div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;</div><div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;</div><div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;  <span class="keywordtype">int</span> waitfordata(<span class="keywordtype">size_t</span> data_count, uint32_t timeout, <span class="keywordtype">size_t</span> *returned_size);</div><div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;</div><div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;</div><div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160;  <span class="keyword">virtual</span> <span class="keywordtype">size_t</span> writeData(<span class="keyword">const</span> uint8_t *data, <span class="keywordtype">size_t</span> size);</div><div class="line"><a name="l00207"></a><span class="lineno">  207</span>&#160;</div><div class="line"><a name="l00208"></a><span class="lineno">  208</span>&#160;</div><div class="line"><a name="l00215"></a><span class="lineno">  215</span>&#160;  <span class="keyword">virtual</span> <span class="keywordtype">size_t</span> readData(uint8_t *data, <span class="keywordtype">size_t</span> size);</div><div class="line"><a name="l00216"></a><span class="lineno">  216</span>&#160;</div><div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160;  <span class="keywordtype">size_t</span> read(uint8_t *buffer, <span class="keywordtype">size_t</span> size);</div><div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160;</div><div class="line"><a name="l00254"></a><span class="lineno">  254</span>&#160;  <span class="keywordtype">size_t</span> read(std::vector&lt;uint8_t&gt; &amp;buffer, <span class="keywordtype">size_t</span> size = 1);</div><div class="line"><a name="l00255"></a><span class="lineno">  255</span>&#160;</div><div class="line"><a name="l00265"></a><span class="lineno">  265</span>&#160;  <span class="keywordtype">size_t</span> read(std::string &amp;buffer, <span class="keywordtype">size_t</span> size = 1);</div><div class="line"><a name="l00266"></a><span class="lineno">  266</span>&#160;</div><div class="line"><a name="l00275"></a><span class="lineno">  275</span>&#160;  std::string read(<span class="keywordtype">size_t</span> size = 1);</div><div class="line"><a name="l00276"></a><span class="lineno">  276</span>&#160;</div><div class="line"><a name="l00288"></a><span class="lineno">  288</span>&#160;  <span class="keywordtype">size_t</span> readline(std::string &amp;buffer, <span class="keywordtype">size_t</span> size = 65536, std::string eol = <span class="stringliteral">&quot;\n&quot;</span>);</div><div class="line"><a name="l00289"></a><span class="lineno">  289</span>&#160;</div><div class="line"><a name="l00300"></a><span class="lineno">  300</span>&#160;  std::string readline(<span class="keywordtype">size_t</span> size = 65536, std::string eol = <span class="stringliteral">&quot;\n&quot;</span>);</div><div class="line"><a name="l00301"></a><span class="lineno">  301</span>&#160;</div><div class="line"><a name="l00314"></a><span class="lineno">  314</span>&#160;  std::vector&lt;std::string&gt; readlines(<span class="keywordtype">size_t</span> size = 65536, std::string eol = <span class="stringliteral">&quot;\n&quot;</span>);</div><div class="line"><a name="l00315"></a><span class="lineno">  315</span>&#160;</div><div class="line"><a name="l00331"></a><span class="lineno">  331</span>&#160;  <span class="keywordtype">size_t</span> write(<span class="keyword">const</span> uint8_t *data, <span class="keywordtype">size_t</span> size);</div><div class="line"><a name="l00332"></a><span class="lineno">  332</span>&#160;</div><div class="line"><a name="l00342"></a><span class="lineno">  342</span>&#160;  <span class="keywordtype">size_t</span> write(<span class="keyword">const</span> std::vector&lt;uint8_t&gt; &amp;data);</div><div class="line"><a name="l00343"></a><span class="lineno">  343</span>&#160;</div><div class="line"><a name="l00353"></a><span class="lineno">  353</span>&#160;  <span class="keywordtype">size_t</span> write(<span class="keyword">const</span> std::string &amp;data);</div><div class="line"><a name="l00354"></a><span class="lineno">  354</span>&#160;</div><div class="line"><a name="l00363"></a><span class="lineno">  363</span>&#160;  <span class="keywordtype">void</span> setPort(<span class="keyword">const</span> std::string &amp;port);</div><div class="line"><a name="l00364"></a><span class="lineno">  364</span>&#160;</div><div class="line"><a name="l00371"></a><span class="lineno">  371</span>&#160;  std::string getPort() <span class="keyword">const</span>;</div><div class="line"><a name="l00372"></a><span class="lineno">  372</span>&#160;</div><div class="line"><a name="l00409"></a><span class="lineno">  409</span>&#160;  <span class="keywordtype">void</span> setTimeout(<a class="code" href="structserial_1_1_timeout.html">Timeout</a> &amp;timeout);</div><div class="line"><a name="l00410"></a><span class="lineno">  410</span>&#160;</div><div class="line"><a name="l00412"></a><span class="lineno"><a class="line" href="classserial_1_1_serial.html#a4b4be39af3e1c68bc6ac09cb55788c86">  412</a></span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classserial_1_1_serial.html#a4b4be39af3e1c68bc6ac09cb55788c86">setTimeout</a>(uint32_t <a class="code" href="structserial_1_1_timeout.html#ada15f2a0ae478cbb62ef79d1633b2b81">inter_byte_timeout</a>, uint32_t <a class="code" href="structserial_1_1_timeout.html#a099244649dec66b6e0548480edeb2b9f">read_timeout_constant</a>,</div><div class="line"><a name="l00413"></a><span class="lineno">  413</span>&#160;                  uint32_t <a class="code" href="structserial_1_1_timeout.html#a64412753eb2edf1621716dd9f1a4e71e">read_timeout_multiplier</a>, uint32_t <a class="code" href="structserial_1_1_timeout.html#accf01b97f83564f4ce3d6e5f63e21006">write_timeout_constant</a>,</div><div class="line"><a name="l00414"></a><span class="lineno">  414</span>&#160;                  uint32_t <a class="code" href="structserial_1_1_timeout.html#a31ddae32907cff9c3d27fa763981317d">write_timeout_multiplier</a>) {</div><div class="line"><a name="l00415"></a><span class="lineno">  415</span>&#160;    <a class="code" href="structserial_1_1_timeout.html">Timeout</a> timeout(inter_byte_timeout, read_timeout_constant,</div><div class="line"><a name="l00416"></a><span class="lineno">  416</span>&#160;                    read_timeout_multiplier, write_timeout_constant,</div><div class="line"><a name="l00417"></a><span class="lineno">  417</span>&#160;                    write_timeout_multiplier);</div><div class="line"><a name="l00418"></a><span class="lineno">  418</span>&#160;    <span class="keywordflow">return</span> setTimeout(timeout);</div><div class="line"><a name="l00419"></a><span class="lineno">  419</span>&#160;  }</div><div class="line"><a name="l00420"></a><span class="lineno">  420</span>&#160;</div><div class="line"><a name="l00428"></a><span class="lineno">  428</span>&#160;  <a class="code" href="structserial_1_1_timeout.html">Timeout</a> getTimeout() <span class="keyword">const</span>;</div><div class="line"><a name="l00429"></a><span class="lineno">  429</span>&#160;</div><div class="line"><a name="l00441"></a><span class="lineno">  441</span>&#160;  <span class="keywordtype">bool</span> setBaudrate(uint32_t baudrate);</div><div class="line"><a name="l00442"></a><span class="lineno">  442</span>&#160;</div><div class="line"><a name="l00451"></a><span class="lineno">  451</span>&#160;  uint32_t getBaudrate() <span class="keyword">const</span>;</div><div class="line"><a name="l00452"></a><span class="lineno">  452</span>&#160;</div><div class="line"><a name="l00461"></a><span class="lineno">  461</span>&#160;  <span class="keywordtype">bool</span> setBytesize(<a class="code" href="namespaceserial.html#a00b3281fa11cea770c0b0c8a106080f8">bytesize_t</a> bytesize);</div><div class="line"><a name="l00462"></a><span class="lineno">  462</span>&#160;</div><div class="line"><a name="l00469"></a><span class="lineno">  469</span>&#160;  <a class="code" href="namespaceserial.html#a00b3281fa11cea770c0b0c8a106080f8">bytesize_t</a> getBytesize() <span class="keyword">const</span>;</div><div class="line"><a name="l00470"></a><span class="lineno">  470</span>&#160;</div><div class="line"><a name="l00478"></a><span class="lineno">  478</span>&#160;  <span class="keywordtype">bool</span> setParity(<a class="code" href="namespaceserial.html#a8f45d26bf7c9a06659e75b5004a50481">parity_t</a> parity);</div><div class="line"><a name="l00479"></a><span class="lineno">  479</span>&#160;</div><div class="line"><a name="l00486"></a><span class="lineno">  486</span>&#160;  <a class="code" href="namespaceserial.html#a8f45d26bf7c9a06659e75b5004a50481">parity_t</a> getParity() <span class="keyword">const</span>;</div><div class="line"><a name="l00487"></a><span class="lineno">  487</span>&#160;</div><div class="line"><a name="l00495"></a><span class="lineno">  495</span>&#160;  <span class="keywordtype">bool</span> setStopbits(stopbits_t stopbits);</div><div class="line"><a name="l00496"></a><span class="lineno">  496</span>&#160;</div><div class="line"><a name="l00503"></a><span class="lineno">  503</span>&#160;  stopbits_t getStopbits() <span class="keyword">const</span>;</div><div class="line"><a name="l00504"></a><span class="lineno">  504</span>&#160;</div><div class="line"><a name="l00513"></a><span class="lineno">  513</span>&#160;  <span class="keywordtype">bool</span> setFlowcontrol(flowcontrol_t flowcontrol);</div><div class="line"><a name="l00514"></a><span class="lineno">  514</span>&#160;</div><div class="line"><a name="l00521"></a><span class="lineno">  521</span>&#160;  flowcontrol_t getFlowcontrol() <span class="keyword">const</span>;</div><div class="line"><a name="l00522"></a><span class="lineno">  522</span>&#160;</div><div class="line"><a name="l00524"></a><span class="lineno">  524</span>&#160;  <span class="keywordtype">void</span> flush();</div><div class="line"><a name="l00525"></a><span class="lineno">  525</span>&#160;</div><div class="line"><a name="l00527"></a><span class="lineno">  527</span>&#160;  <span class="keywordtype">void</span> flushInput();</div><div class="line"><a name="l00528"></a><span class="lineno">  528</span>&#160;</div><div class="line"><a name="l00530"></a><span class="lineno">  530</span>&#160;  <span class="keywordtype">void</span> flushOutput();</div><div class="line"><a name="l00531"></a><span class="lineno">  531</span>&#160;</div><div class="line"><a name="l00533"></a><span class="lineno">  533</span>&#160;  <span class="keywordtype">void</span> sendBreak(<span class="keywordtype">int</span> duration);</div><div class="line"><a name="l00534"></a><span class="lineno">  534</span>&#160;</div><div class="line"><a name="l00536"></a><span class="lineno">  536</span>&#160;  <span class="keywordtype">bool</span> setBreak(<span class="keywordtype">bool</span> level = <span class="keyword">true</span>);</div><div class="line"><a name="l00537"></a><span class="lineno">  537</span>&#160;</div><div class="line"><a name="l00539"></a><span class="lineno">  539</span>&#160;  <span class="keywordtype">bool</span> setRTS(<span class="keywordtype">bool</span> level = <span class="keyword">true</span>);</div><div class="line"><a name="l00540"></a><span class="lineno">  540</span>&#160;</div><div class="line"><a name="l00542"></a><span class="lineno">  542</span>&#160;  <span class="keywordtype">bool</span> setDTR(<span class="keywordtype">bool</span> level = <span class="keyword">true</span>);</div><div class="line"><a name="l00543"></a><span class="lineno">  543</span>&#160;</div><div class="line"><a name="l00557"></a><span class="lineno">  557</span>&#160;  <span class="keywordtype">bool</span> waitForChange();</div><div class="line"><a name="l00558"></a><span class="lineno">  558</span>&#160;</div><div class="line"><a name="l00560"></a><span class="lineno">  560</span>&#160;  <span class="keywordtype">bool</span> getCTS();</div><div class="line"><a name="l00561"></a><span class="lineno">  561</span>&#160;</div><div class="line"><a name="l00563"></a><span class="lineno">  563</span>&#160;  <span class="keywordtype">bool</span> getDSR();</div><div class="line"><a name="l00564"></a><span class="lineno">  564</span>&#160;</div><div class="line"><a name="l00566"></a><span class="lineno">  566</span>&#160;  <span class="keywordtype">bool</span> getRI();</div><div class="line"><a name="l00567"></a><span class="lineno">  567</span>&#160;</div><div class="line"><a name="l00569"></a><span class="lineno">  569</span>&#160;  <span class="keywordtype">bool</span> getCD();</div><div class="line"><a name="l00570"></a><span class="lineno">  570</span>&#160;</div><div class="line"><a name="l00572"></a><span class="lineno">  572</span>&#160;  <span class="keywordtype">int</span> getByteTime();</div><div class="line"><a name="l00573"></a><span class="lineno">  573</span>&#160;</div><div class="line"><a name="l00574"></a><span class="lineno">  574</span>&#160;</div><div class="line"><a name="l00575"></a><span class="lineno">  575</span>&#160; <span class="keyword">private</span>:</div><div class="line"><a name="l00576"></a><span class="lineno">  576</span>&#160;  <span class="comment">// Disable copy constructors</span></div><div class="line"><a name="l00577"></a><span class="lineno">  577</span>&#160;  <a class="code" href="classserial_1_1_serial.html">Serial</a>(<span class="keyword">const</span> <a class="code" href="classserial_1_1_serial.html">Serial</a> &amp;);</div><div class="line"><a name="l00578"></a><span class="lineno">  578</span>&#160;  <a class="code" href="classserial_1_1_serial.html">Serial</a> &amp;operator=(<span class="keyword">const</span> <a class="code" href="classserial_1_1_serial.html">Serial</a> &amp;);</div><div class="line"><a name="l00579"></a><span class="lineno">  579</span>&#160;</div><div class="line"><a name="l00580"></a><span class="lineno">  580</span>&#160;  <span class="comment">// Pimpl idiom, d_pointer</span></div><div class="line"><a name="l00581"></a><span class="lineno">  581</span>&#160;  <span class="keyword">class </span><a class="code" href="classserial_1_1_serial_1_1_serial_impl.html">SerialImpl</a>;</div><div class="line"><a name="l00582"></a><span class="lineno">  582</span>&#160;  <a class="code" href="classserial_1_1_serial_1_1_serial_impl.html">SerialImpl</a> *pimpl_;</div><div class="line"><a name="l00583"></a><span class="lineno">  583</span>&#160;</div><div class="line"><a name="l00584"></a><span class="lineno">  584</span>&#160;  <span class="comment">// Scoped Lock Classes</span></div><div class="line"><a name="l00585"></a><span class="lineno">  585</span>&#160;  <span class="keyword">class </span><a class="code" href="classserial_1_1_serial_1_1_scoped_read_lock.html">ScopedReadLock</a>;</div><div class="line"><a name="l00586"></a><span class="lineno">  586</span>&#160;  <span class="keyword">class </span><a class="code" href="classserial_1_1_serial_1_1_scoped_write_lock.html">ScopedWriteLock</a>;</div><div class="line"><a name="l00587"></a><span class="lineno">  587</span>&#160;</div><div class="line"><a name="l00588"></a><span class="lineno">  588</span>&#160;  <span class="comment">// Read common function</span></div><div class="line"><a name="l00589"></a><span class="lineno">  589</span>&#160;  <span class="keywordtype">size_t</span> read_(uint8_t *buffer, <span class="keywordtype">size_t</span> size);</div><div class="line"><a name="l00590"></a><span class="lineno">  590</span>&#160;  <span class="comment">// Write common function</span></div><div class="line"><a name="l00591"></a><span class="lineno">  591</span>&#160;  <span class="keywordtype">size_t</span> write_(<span class="keyword">const</span> uint8_t *data, <span class="keywordtype">size_t</span> length);</div><div class="line"><a name="l00592"></a><span class="lineno">  592</span>&#160;};</div><div class="line"><a name="l00593"></a><span class="lineno">  593</span>&#160;</div><div class="line"><a name="l00594"></a><span class="lineno">  594</span>&#160;</div><div class="line"><a name="l00598"></a><span class="lineno"><a class="line" href="structserial_1_1_port_info.html">  598</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structserial_1_1_port_info.html">PortInfo</a> {</div><div class="line"><a name="l00599"></a><span class="lineno">  599</span>&#160;</div><div class="line"><a name="l00601"></a><span class="lineno"><a class="line" href="structserial_1_1_port_info.html#a5d4242cdd6c0d01260e24964af4c23d2">  601</a></span>&#160;  std::string <a class="code" href="structserial_1_1_port_info.html#a5d4242cdd6c0d01260e24964af4c23d2">port</a>;</div><div class="line"><a name="l00602"></a><span class="lineno">  602</span>&#160;</div><div class="line"><a name="l00604"></a><span class="lineno"><a class="line" href="structserial_1_1_port_info.html#a2ba37dd33d47b554aef5c15c1fe8b872">  604</a></span>&#160;  std::string <a class="code" href="structserial_1_1_port_info.html#a2ba37dd33d47b554aef5c15c1fe8b872">description</a>;</div><div class="line"><a name="l00605"></a><span class="lineno">  605</span>&#160;</div><div class="line"><a name="l00607"></a><span class="lineno"><a class="line" href="structserial_1_1_port_info.html#a7d55368e1a4e6ccc9da6f4d339524837">  607</a></span>&#160;  std::string <a class="code" href="structserial_1_1_port_info.html#a7d55368e1a4e6ccc9da6f4d339524837">hardware_id</a>;</div><div class="line"><a name="l00608"></a><span class="lineno">  608</span>&#160;</div><div class="line"><a name="l00610"></a><span class="lineno"><a class="line" href="structserial_1_1_port_info.html#af6a8211d14bccb07b538ac584d195466">  610</a></span>&#160;  std::string <a class="code" href="structserial_1_1_port_info.html#af6a8211d14bccb07b538ac584d195466">device_id</a>;</div><div class="line"><a name="l00611"></a><span class="lineno">  611</span>&#160;</div><div class="line"><a name="l00612"></a><span class="lineno">  612</span>&#160;};</div><div class="line"><a name="l00613"></a><span class="lineno">  613</span>&#160;</div><div class="line"><a name="l00614"></a><span class="lineno">  614</span>&#160;<span class="comment">/* Lists the serial ports available on the system</span></div><div class="line"><a name="l00615"></a><span class="lineno">  615</span>&#160;<span class="comment">*</span></div><div class="line"><a name="l00616"></a><span class="lineno">  616</span>&#160;<span class="comment">* Returns a vector of available serial ports, each represented</span></div><div class="line"><a name="l00617"></a><span class="lineno">  617</span>&#160;<span class="comment">* by a serial::PortInfo data structure:</span></div><div class="line"><a name="l00618"></a><span class="lineno">  618</span>&#160;<span class="comment">*</span></div><div class="line"><a name="l00619"></a><span class="lineno">  619</span>&#160;<span class="comment">* \return vector of serial::PortInfo.</span></div><div class="line"><a name="l00620"></a><span class="lineno">  620</span>&#160;<span class="comment">*/</span></div><div class="line"><a name="l00621"></a><span class="lineno">  621</span>&#160;std::vector&lt;PortInfo&gt;</div><div class="line"><a name="l00622"></a><span class="lineno">  622</span>&#160;list_ports();</div><div class="line"><a name="l00623"></a><span class="lineno">  623</span>&#160;</div><div class="line"><a name="l00624"></a><span class="lineno">  624</span>&#160;} <span class="comment">// namespace serial</span></div><div class="line"><a name="l00625"></a><span class="lineno">  625</span>&#160;</div><div class="line"><a name="l00626"></a><span class="lineno">  626</span>&#160;<span class="preprocessor">#endif</span></div><div class="ttc" id="classserial_1_1_serial_html_a4b4be39af3e1c68bc6ac09cb55788c86"><div class="ttname"><a href="classserial_1_1_serial.html#a4b4be39af3e1c68bc6ac09cb55788c86">serial::Serial::setTimeout</a></div><div class="ttdeci">void setTimeout(uint32_t inter_byte_timeout, uint32_t read_timeout_constant, uint32_t read_timeout_multiplier, uint32_t write_timeout_constant, uint32_t write_timeout_multiplier)</div><div class="ttdef"><b>Definition:</b> serial.h:412</div></div>
<div class="ttc" id="structserial_1_1_port_info_html_a7d55368e1a4e6ccc9da6f4d339524837"><div class="ttname"><a href="structserial_1_1_port_info.html#a7d55368e1a4e6ccc9da6f4d339524837">serial::PortInfo::hardware_id</a></div><div class="ttdeci">std::string hardware_id</div><div class="ttdef"><b>Definition:</b> serial.h:607</div></div>
<div class="ttc" id="classserial_1_1_serial_1_1_scoped_write_lock_html"><div class="ttname"><a href="classserial_1_1_serial_1_1_scoped_write_lock.html">serial::Serial::ScopedWriteLock</a></div><div class="ttdef"><b>Definition:</b> serial.cpp:44</div></div>
<div class="ttc" id="namespaceserial_html_a8f45d26bf7c9a06659e75b5004a50481"><div class="ttname"><a href="namespaceserial.html#a8f45d26bf7c9a06659e75b5004a50481">serial::parity_t</a></div><div class="ttdeci">parity_t</div><div class="ttdef"><b>Definition:</b> serial.h:26</div></div>
<div class="ttc" id="namespaceserial_html_a00b3281fa11cea770c0b0c8a106080f8"><div class="ttname"><a href="namespaceserial.html#a00b3281fa11cea770c0b0c8a106080f8">serial::bytesize_t</a></div><div class="ttdeci">bytesize_t</div><div class="ttdef"><b>Definition:</b> serial.h:16</div></div>
<div class="ttc" id="structserial_1_1_port_info_html_af6a8211d14bccb07b538ac584d195466"><div class="ttname"><a href="structserial_1_1_port_info.html#af6a8211d14bccb07b538ac584d195466">serial::PortInfo::device_id</a></div><div class="ttdeci">std::string device_id</div><div class="ttdef"><b>Definition:</b> serial.h:610</div></div>
<div class="ttc" id="namespaceserial_html"><div class="ttname"><a href="namespaceserial.html">serial</a></div><div class="ttdef"><b>Definition:</b> serial.h:11</div></div>
<div class="ttc" id="structserial_1_1_timeout_html_a64412753eb2edf1621716dd9f1a4e71e"><div class="ttname"><a href="structserial_1_1_timeout.html#a64412753eb2edf1621716dd9f1a4e71e">serial::Timeout::read_timeout_multiplier</a></div><div class="ttdeci">uint32_t read_timeout_multiplier</div><div class="ttdef"><b>Definition:</b> serial.h:85</div></div>
<div class="ttc" id="structserial_1_1_timeout_html_a31ddae32907cff9c3d27fa763981317d"><div class="ttname"><a href="structserial_1_1_timeout.html#a31ddae32907cff9c3d27fa763981317d">serial::Timeout::write_timeout_multiplier</a></div><div class="ttdeci">uint32_t write_timeout_multiplier</div><div class="ttdef"><b>Definition:</b> serial.h:91</div></div>
<div class="ttc" id="structserial_1_1_timeout_html"><div class="ttname"><a href="structserial_1_1_timeout.html">serial::Timeout</a></div><div class="ttdef"><b>Definition:</b> serial.h:58</div></div>
<div class="ttc" id="structserial_1_1_port_info_html_a2ba37dd33d47b554aef5c15c1fe8b872"><div class="ttname"><a href="structserial_1_1_port_info.html#a2ba37dd33d47b554aef5c15c1fe8b872">serial::PortInfo::description</a></div><div class="ttdeci">std::string description</div><div class="ttdef"><b>Definition:</b> serial.h:604</div></div>
<div class="ttc" id="structserial_1_1_port_info_html"><div class="ttname"><a href="structserial_1_1_port_info.html">serial::PortInfo</a></div><div class="ttdef"><b>Definition:</b> serial.h:598</div></div>
<div class="ttc" id="structserial_1_1_timeout_html_a099244649dec66b6e0548480edeb2b9f"><div class="ttname"><a href="structserial_1_1_timeout.html#a099244649dec66b6e0548480edeb2b9f">serial::Timeout::read_timeout_constant</a></div><div class="ttdeci">uint32_t read_timeout_constant</div><div class="ttdef"><b>Definition:</b> serial.h:81</div></div>
<div class="ttc" id="structserial_1_1_timeout_html_ada15f2a0ae478cbb62ef79d1633b2b81"><div class="ttname"><a href="structserial_1_1_timeout.html#ada15f2a0ae478cbb62ef79d1633b2b81">serial::Timeout::inter_byte_timeout</a></div><div class="ttdeci">uint32_t inter_byte_timeout</div><div class="ttdef"><b>Definition:</b> serial.h:79</div></div>
<div class="ttc" id="structserial_1_1_port_info_html_a5d4242cdd6c0d01260e24964af4c23d2"><div class="ttname"><a href="structserial_1_1_port_info.html#a5d4242cdd6c0d01260e24964af4c23d2">serial::PortInfo::port</a></div><div class="ttdeci">std::string port</div><div class="ttdef"><b>Definition:</b> serial.h:601</div></div>
<div class="ttc" id="namespaceserial_html_af5b116611d6628a3aa8f788fdc09f469"><div class="ttname"><a href="namespaceserial.html#af5b116611d6628a3aa8f788fdc09f469">serial::stopbits_t</a></div><div class="ttdeci">stopbits_t</div><div class="ttdef"><b>Definition:</b> serial.h:37</div></div>
<div class="ttc" id="classserial_1_1_serial_1_1_scoped_read_lock_html"><div class="ttname"><a href="classserial_1_1_serial_1_1_scoped_read_lock.html">serial::Serial::ScopedReadLock</a></div><div class="ttdef"><b>Definition:</b> serial.cpp:28</div></div>
<div class="ttc" id="classserial_1_1_serial_1_1_serial_impl_html"><div class="ttname"><a href="classserial_1_1_serial_1_1_serial_impl.html">serial::Serial::SerialImpl</a></div><div class="ttdef"><b>Definition:</b> unix_serial.h:27</div></div>
<div class="ttc" id="structserial_1_1_timeout_html_accf01b97f83564f4ce3d6e5f63e21006"><div class="ttname"><a href="structserial_1_1_timeout.html#accf01b97f83564f4ce3d6e5f63e21006">serial::Timeout::write_timeout_constant</a></div><div class="ttdeci">uint32_t write_timeout_constant</div><div class="ttdef"><b>Definition:</b> serial.h:87</div></div>
<div class="ttc" id="classserial_1_1_serial_html"><div class="ttname"><a href="classserial_1_1_serial.html">serial::Serial</a></div><div class="ttdef"><b>Definition:</b> serial.h:109</div></div>
<div class="ttc" id="structserial_1_1_timeout_html_aa4fbd72e16f47c9aea9fb3c32ca17828"><div class="ttname"><a href="structserial_1_1_timeout.html#aa4fbd72e16f47c9aea9fb3c32ca17828">serial::Timeout::simpleTimeout</a></div><div class="ttdeci">static Timeout simpleTimeout(uint32_t timeout)</div><div class="ttdef"><b>Definition:</b> serial.h:74</div></div>
<div class="ttc" id="namespaceserial_html_a93ef57a314b4e562f9eded6c15d34351"><div class="ttname"><a href="namespaceserial.html#a93ef57a314b4e562f9eded6c15d34351">serial::flowcontrol_t</a></div><div class="ttdeci">flowcontrol_t</div><div class="ttdef"><b>Definition:</b> serial.h:46</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
